<template>
  <div>
    <label for="" v-for="(item, index) in arr" :key="index"
      ><input type="checkbox" name="" id="" :value="item" v-model="total" />{{
        item
      }}</label
    >
    <div>您选中的元素的和为:{{ all }}</div>
  </div>
</template>

<script>
export default {
  name: "0",
  components: {},
  props: {},
  data() {
    return {
      arr: [9, 15, 19, 25, 29, 31, 48, 57, 62, 79, 87],
      total: [],
    };
  },
  computed: {
    all() {
      return this.total.reduce((sum, item) => sum + item, 0);
    },
  },
  watch: {},
  created() {},
  methods: {},
};
</script>

<style scoped></style>
